<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://www.springframework.org/tags" prefix="s" %>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="sf"%>

<%@ page session="false" %>
<html>
<head>
	<title>edit city</title>
</head>
<body>
<h1>
	Person Form
</h1>

<div>
	<h2>Insert some data</h2>
	
	<s:url value="/person/save" var="personSave_url"/>
	
	<sf:form method="POST" modelAttribute="person" action="${personSave_url}">
	<fieldset>
		<sf:hidden path="id"/>
		<table cellspacing="0" width=250 >
		
			<tr>
				<th><label for="person_name">Name:</label></th>
				<td><sf:input path="name" size="15" id="person_name"/></td>
			</tr>
			<tr>
				<th><label for="person_city">City:</label></th>
				<td>
					<sf:select path="city.id"> 
						<sf:option value="" label="Select" /> 
						<sf:options items="${cityList}" itemValue="id" itemLabel="name" /> 
					</sf:select>
				</td>
			</tr>
			
			<tr>
				<th><label for="philosopher">Philosopher:</label></th>
				<td>
					<sf:checkbox path="philosopher" id="philosopher"/>
				</td>
			</tr>
			<tr>
				<th></th>
				<td><input name="commit" type="submit" value="Save"/></td>					
			</tr>
		</table>
	</fieldset>
	</sf:form>
	
</div>

<p>
	<div>
		<s:url value="/person" var="persons_url"/>
		<a href="${persons_url}"> Persons </a>
	</div>
</p>


</body>
</html>
